Skip to content

[CI]【Hackathon 10th Spring No.29】engine unit test#6771

Draft
cloudforge1 wants to merge 1 commit intoPaddlePaddle:developfrom
cloudforge1:task/h10-029-engine-test
Draft

[CI]【Hackathon 10th Spring No.29】engine unit test#6771
cloudforge1 wants to merge 1 commit intoPaddlePaddle:developfrom
cloudforge1:task/h10-029-engine-test

Conversation

@cloudforge1
Copy link
Contributor

@cloudforge1 cloudforge1 commented Mar 10, 2026

Motivation

No.29 功能模块 fastdeploy/engine/engine.py 单测补充

Modifications

add unittest tests/engine/test_engine.py

develop 分支:覆盖率50%,Miss行数187(98, 145-147, 158-161, 172, 179-182, 185-194, 206-207, 212->228, 235, 268->270, 273->277, 294-299, 302-304, 307-324, 327-337, 350-352, 381-384, 402->exit, 404, 422->436, 423->425, 425->427, 428-433, 439->442, 442->449, 450, 453-457, 492-498, 541->556, 547->556, 551, 555, 556->558, 571, 622, 628, 659, 662, 675-695, 708-737, 745->748, 747, 753->exit, 762-767, 771-775, 780, 782, 786->exit, 788-830, 837-889)

当前PR:覆盖率80%,Miss行数86

完成单测覆盖行数187-86=101

Usage or Command

pytest tests/engine/test_engine.py

Accuracy Tests

no need

Checklist

  • Add at least a tag in the PR title.
    • Tag list: [[FDConfig],[APIServer],[Engine], [Scheduler], [PD Disaggregation], [Executor], [Graph Optimization], [Speculative Decoding], [RL], [Models], [Quantization], [Loader], [OP], [KVCache], [DataProcessor], [BugFix], [Docs], [CI], [Optimization], [Feature], [Benchmark], [Others], [XPU], [HPU], [GCU], [DCU], [Iluvatar], [Metax]]
    • You can add new tags based on the PR content, but the semantics must be clear.
  • Format your code, run pre-commit before commit.
  • Add unit tests. Please write the reason in this PR if no unit tests.
  • Provide accuracy results.
  • If the current PR is submitting to the release branch, make sure the PR has been submitted to the develop branch, then cherry-pick it to the release branch with the [Cherry-Pick] PR tag.

@paddle-bot
Copy link

paddle-bot bot commented Mar 10, 2026

Thanks for your contribution!

@codecov-commenter
Copy link

codecov-commenter commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@49fe68a). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop    #6771   +/-   ##
==========================================
  Coverage           ?   73.62%           
==========================================
  Files              ?      395           
  Lines              ?    54986           
  Branches           ?     8656           
==========================================
  Hits               ?    40483           
  Misses             ?    11620           
  Partials           ?     2883           
Flag Coverage Δ
GPU 73.62% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add tests/engine/test_engine.py (469 lines, 14 tests)
- monkeypatch + SimpleNamespace (no MagicMock)
- object.__new__(LLMEngine) bypass for GPU-free testing
- Local Coverage: 90% (430 stmts, 44 miss)
- Develop baseline: 50% (official CSV)
- 15 source methods covered
@cloudforge1 cloudforge1 force-pushed the task/h10-029-engine-test branch from be99f74 to 99c952f Compare March 13, 2026 07:56
@cloudforge1 cloudforge1 marked this pull request as draft March 14, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants